package com.byyy.ccts.modules.ysjl.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.byyy.ccts.core.common.entity.AbstractEntity;
import com.byyy.ccts.modules.ysjl.enums.ActivityCateEnum;
import com.byyy.ccts.modules.ysjl.reqvo.FormReqVo;
import lombok.Data;

import java.sql.Timestamp;
import java.util.List;

/**
 * @projectName: TODO
 * @package: com.byyy.ccts.modules.ysjl.entity
 * @className: YsjlActivity
 * @description: TODO
 * @author: LYB
 * @Date: 2023/9/3 16:12
 * @updateUser: LYB
 * @updateDate: 2023/9/3 16:12
 * @updateRemark:
 * @version: v1.0
 */
@TableName("T_YSJL_ACTIVITY")
@Data
public class YsjlActivity extends AbstractEntity<String> {

    @TableId(value="ID", type = IdType.UUID)
    @TableField(value="ID")
    private String id;
    @TableField(value="TITLE")
    private String title;
    @TableField(value="STATUS")
    private int status;
    @TableField(value="CATE_ID")
    private int cateId;
    @TableField(value="MAX_CNT")
    private int maxCnt;
    @TableField(value="START_TIME")
    @JSONField(format ="yyyy-MM-dd HH:mm:ss")
    private Timestamp startTime;
    @TableField(value="END_TIME")
    @JSONField(format ="yyyy-MM-dd HH:mm:ss")
    private Timestamp endTime;
    @TableField(value="STOP_TIME")
    @JSONField(format ="yyyy-MM-dd HH:mm:ss")
    private Timestamp stopTime;
    @TableField(value="PIC")
    private String pic;
    @TableField(value="ADDRESS")
    private String address;
    @TableField(value="ADDRESS_LAT")
    private float addressLat;
    @TableField(value="ADDRESS_LON")
    private float addressLon;
    @TableField(value="QR")
    private String qr;
    @TableField(value="VIEW_CNT")
    private int viewCnt;
    @TableField(value="COMMENT_CNT")
    private int commentCnt;
    @TableField(value="ADD_TIME")
    @JSONField(format ="yyyy-MM-dd HH:mm:ss")
    private Timestamp addTime;
    @TableField(value="EDIT_TIME")
    @JSONField(format ="yyyy-MM-dd HH:mm:ss")
    private Timestamp editTime;
    @TableField(value="FEE")
    private String fee;

    @TableField(exist = false)
    private String week;
    @TableField(exist = false)
    private String showTime;
    @TableField(exist = false)
    private String cateName;
    @TableField(exist = false)
    private String cateStyle;
    @TableField(exist = false)
    private String statusName;
    @TableField(exist = false)
    private String userId;
    @TableField(exist = false)
    private float hour;
    @TableField(exist = false)
    private int joinCnt;
    @TableField(exist = false)
    private int userJoinCnt;
    @TableField(exist = false)
    private int userSuccessJoinCnt;
    @TableField(exist = false)
    private boolean currentUser;
    @TableField(exist = false)
    private List<YsjlActivityEnroll> enrollList;
    @TableField(exist = false)
    private List<String> picList;
    @TableField(exist = false)
    private List<YsjlActivityFlow> flowList;
    @TableField(exist = false)
    private List<FormReqVo> forms;
    @TableField(exist = false)
    private List<YsjlLog> logList;

    public String getCateName() {
        return ActivityCateEnum.getMsgByCode(this.cateId);
    }
    public String getCateStyle() {
        return ActivityCateEnum.getStyleByCode(this.cateId);
    }
}
